package com.kfm.spring.service;

import com.kfm.spring.dao.IAccountDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.inject.Inject;

@Service
@Scope(ConfigurableBeanFactory.SCOPE_SINGLETON)
public class BeanService {

//    @Autowired
//    @Qualifier("accountDaoImpl2")
//    @Resource(type = IAccountDao.class, name = "accountDaoImpl")
    @Inject
    private IAccountDao accountDao;

    @Value("${name}")
    private String name;

    public void get(){
        System.out.println(accountDao + " ,name = " + name);
    }
}
